package cn.edu.lnpu.api.cms;

import cn.edu.lnpu.common.model.response.QueryResponseResult;
import cn.edu.lnpu.common.model.response.ResponseResult;
import cn.edu.lnpu.domain.cms.CmsPage;
import cn.edu.lnpu.domain.cms.request.QueryPageRequest;
import cn.edu.lnpu.domain.cms.response.CmsPageResult;
import cn.edu.lnpu.domain.cms.response.CmsPostPageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value="cms页面管理接口",tags = "cms页面管理接口，提供页面的增、删、改、查")
public interface CmsPageControllerApi {
    //页面查询
    @ApiOperation("分页查询页面列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name="page",value = "页码",required=true,paramType="path",dataType="int"),
            @ApiImplicitParam(name="size",value = "每页记录数",required=true,paramType="path",dataType="int")
    })
    QueryResponseResult<CmsPage> findList(int page, int size, QueryPageRequest queryPageRequest);

    @ApiOperation(value = "新增页面")
    CmsPageResult add(CmsPage cmsPage);

    @ApiOperation("修改页面")
    CmsPageResult edit(String id,CmsPage cmsPage);

    @ApiOperation("根据页面ID查询页面数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name="id",value = "页面ID",required=true,paramType="path")
    })
    CmsPage findById(String id);

    @ApiOperation("通过ID删除页面")
    @ApiImplicitParams({
            @ApiImplicitParam(name="id",value = "页面ID",required=true,paramType="path")
    })
    ResponseResult delete(String id);

    @ApiOperation("发布页面")
    ResponseResult post(String pageId);

    @ApiOperation("保存页面")
    public CmsPageResult save(CmsPage cmsPage);

    @ApiOperation("一键发布页面")
    public CmsPostPageResult postPageQuick(CmsPage cmsPage);
}
